<script setup lang="ts">
const props: any = defineProps<{
    ujt: any;
    type?: number;
}>();

const { $fn, $global } = props.ujt;
const { initUserToken } = $fn.useInitUser(props.ujt, 'webserver');
initUserToken();
</script>

<template>
    <div class="as-usercard" v-if="$global.lang?.asai?.usercard">
        <div
            @pointerdown="
                $fn.sethash($global.sys?.router?.config?.login || 'user/login')
            "
        >
            <AsSvg color="var(--cm8)" height="26px" :src="'asai/login'"></AsSvg>
            {{ $global.lang.asai.usercard?.login }}
        </div>
        <div class="cur" @pointerdown="$fn.As.localInit()" title="ctrl+shift+r">
            <AsSvg color="var(--cm0)" height="26px" :src="'asai/reset'"></AsSvg>
            {{ $global.lang.asai.usercard?.reset }}
        </div>
    </div>
</template>

<style scoped lang="scss">
.as-usercard {
    display: inline-flex;
    > div {
        text-align: center;
        background-color: var(--cm0);
        color: var(--cm8);
        border-radius: var(--radius);
        margin: 0 10px;
        padding: 5px 12px;
        cursor: pointer;
        &:hover {
            background-color: var(--cm2);
        }
    }
    .cur {
        background-color: var(--cm8);
        color: var(--cm0);
        &:hover {
            background-color: var(--cm6);
        }
    }
}
</style>
